{% extends 'model/base.html' %}
{% block title %}已归还图书{% endblock %}
{% block script %}
<script>
     $(function () {

     })
</script>
{% endblock %}
{% block StyleSheet %}
<style>

</style>
{% endblock %}
{% block content %}
  <div class="row">
          <div class="col-12">
            <div class="card">
              <div class="card-header">
                <h3 class="card-title">违规记录</h3>

                <div class="card-tools">

                </div>
              </div>
              <!-- /.card-header -->
              <div class="card-body table-responsive p-0" style="height: 540px;margin-top: 20px">
                <table class="table table-hover table-head-fixed text-nowrap">
                  <thead>
                    <tr>
                      <th>借书编号</th>
                      <th>书名</th>
                      <th>作者</th>
                      <th>出版社</th>
                      <th>逾期时间</th>
                        <th>罚金</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                  </thead>
                  <tbody>
                    {% for br,fine in illegal_record %}
                        <tr id="{{ br.id }}">
                          <td>{{ br.id }}</td>
                          <td>{{ br.BookID.BName }}</td>
                          <td>{{ br.BookID.Author }}</td>
                          <td>{{ br.BookID.Publisher }}</td>
                        <td>{{ fine.days }}天</td>
                        <td>{{ fine.fine_money }}元</td>

                            {% if not br.isReturned %}
                                <td ><button class="btn btn-success btn-sm" style="background-color: rgba(224,198,0,0.88);cursor: text">未归还</button></td>
                            {% else %}
                            <td ><button class="btn btn-danger btn-sm" style="background-color: #f15b6c;cursor: text">逾期归还</button></td>
                            {% endif %}
                            <td><a href="{% url 'illegal' br.id %}" target="_blank"><button class="btn btn-outline-primary btn-sm" >查看处罚报告</button></a></td>
                    </tr>
                    {% endfor %}
                  </tbody>
                </table>
              </div>
              <!-- /.card-body -->
            </div>
            <!-- /.card -->
          </div>
        </div>
{% endblock %}


